From 82d9f4e241c66e462d5406dd61bf2d73d249085b Mon Sep 17 00:00:00 2001 From: oliskoli Date: Fri, 15 Aug 2008 21:16:34 +0000 Subject: [PATCH] util: Fix memory leak test. --- util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index 0a1caf42d..07bd7355e 100644 --- a/util.c +++ b/util.c @@ -210,8 +210,10 @@ xrealloc(void *p, size_t s) { char *o = (char *) realloc(p,s); #ifdef DEBUG_MEM - debug_mem_output( "realloc, %x, %x, %x, %s, %d\n", - o, p, s, file, line ); + if (p != NULL) + debug_mem_output( "realloc, %x, %x, %x, %s, %d\n", o, p, s, file, line ); + else + debug_mem_output( "malloc, %x, %d, %s, %d\n", o, s, file, line ); #endif if (!o) { -- 2.30.2